<?
$i=$_GET["i"];
$r=$_GET["r"];
if ($r=="") {
   header('Content-Type: video/x-ms-asf');
header('Content-Disposition: attachment; filename=pimp.asx');?>
<ASX version = "3.0">
<TITLE><?= filetitle($i) ?></TITLE>
<Entry> 
<TITLE><?= filetitle($i) ?></TITLE> 
<AUTHOR>ThePIMP</AUTHOR> <COPYRIGHT>2005</COPYRIGHT> 
<ref href="<?= $i ?>">
</Entry>  
</ASX>  
<?
   } else {
   header ('Content-Type: audio/x-pn-realaudio');
header('Content-Disposition: attachment; filename=pimp.ram');
print $i;
   }


function filetitle($path,$limit=0) { 
    $v = explode ("/", $path);
	$v = $v[count($v)-1];
	if ($limit>0) $v=substr($v,0,$limit).(strlen($v)>$limit?"...":"");
	return $v;
}
   
?>